package launcher;

import java.io.File;
import java.io.ObjectInputStream.GetField;
import java.util.Scanner;
import java.util.Vector;


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;

import metrics.NormalizedPRStatictic;
import metrics.PrRcGraph;

import org.jfree.ui.RefineryUtilities;

import query.VectorQueryLibrary;
import document.DocumentLibrary;
import document.InvertedIndex;
import document.Stemmer;
import document.StopWordLexicon;

public class ShowGraphRelevance {

	//private static final String DOC_PATH =  "TIME" + File.separator + "Test_Docs";
	//private static final String QUERY_PATH =  "TIME" + File.separator + "Test_Queries";
	private static final String DOC_PATH =  "TIME" + File.separator + "Docs";
 	private static final String QUERY_PATH =  "TIME" + File.separator + "IR_2nd_Project_Queries";
        private static final String WORD_TYPES = "TIME" + File.separator + "English_Words_Types.txt";
	
	public static void main(String[] args) 
	{

                //######## locally expanded queries #########

		Vector<NormalizedPRStatictic> entries = new Vector<NormalizedPRStatictic>();
		
		StopWordLexicon.setDisabled(true);
		Stemmer.setDisabled(true);
		DocumentLibrary library = new DocumentLibrary();
		library.initializeFrom(DOC_PATH);
		InvertedIndex index = new InvertedIndex();
		index.indexLibrary(library);
		
		VectorQueryLibrary lib = new VectorQueryLibrary();
		lib.initializeFrom(QUERY_PATH);
		
		lib.processAll(index);
		NormalizedPRStatictic s1 = lib.getStatistics();
		s1.setLabel("First Round");
		entries.add(s1);
		
		lib.processAllRelevance(index, 0.5, 0.5, 0);
		NormalizedPRStatictic s2 = lib.getStatistics();
		s2.setLabel("2nd Round 0.5 0.5");
		entries.add(s2);
		
		lib.processAllRelevance(index, 0.75, 0.25, 0);
		NormalizedPRStatictic s3 = lib.getStatistics();
		s3.setLabel("2nd Round 0.75 0.25");
		entries.add(s3);
		
		lib.processAllRelevance(index, 0.25, 0.75, 0);
		NormalizedPRStatictic s4 = lib.getStatistics();
		s4.setLabel("2nd Round 0.25 0.75");
		entries.add(s4);


                //######## globally expanded queries #########

                VectorQueryLibrary g_lib = new VectorQueryLibrary();
		g_lib.initializeWithSynset(QUERY_PATH);

		g_lib.processAll(index);
		NormalizedPRStatictic s5 = g_lib.getStatistics();
		s5.setLabel("With Synset");
		entries.add(s5);
		
		PrRcGraph graph = new PrRcGraph(entries);
                graph.pack();
                RefineryUtilities.centerFrameOnScreen(graph);
                graph.setVisible(true);


	}

}
